<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="新增用户" bodyClass="white-bg" libs=["bootstrapSelect"]/>
<div class="wrapper wrapper-content ibox-content">
    <@f.form id="form-user-add" class="form-horizontal">
    <h4 class="form-header h4">填写基本信息</h4>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>员工编号：</label>
                <div class="col-sm-8">
                    <@f.input name="userCode" placeholder="请输入员工编号" required=true helpTip="员工编号，如A0001"/>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>员工姓名：</label>
                <div class="col-sm-8">
                    <@f.input name="userName" placeholder="请输入员工姓名" required=true />
                </div>
            </div>
        </div>

    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>性 别：</label>
                <div class="col-sm-8">
                    <@f.radio name="sex" dictType="sys_user_sex" value=""  />
                    <!--<input name="sex" id="sex" placeholder="请输入用户名称" class="form-control" type="text" maxlength="30" required>-->
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "出生日期"/>：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>

                        <input class="form-control time-input" name="birthday"  data-type="date" data-format="yyyy-MM-dd HH:mm:ss" type="text"  required>
                        <!--readonly="true"-->
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">

        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "录用日期："/>：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>

                        <input class="form-control time-input" name="employTime"  data-type="date" data-format="yyyy-MM-dd HH:mm:ss" type="text"  required>
                        <!--readonly="true"-->
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>婚姻状况：</label>
                <div class="col-sm-8">
                    <@f.select name="marriage" dictType="sys_marriage" blankValue=""/>
                    <!--<input name="marriage" id="marriage" placeholder="请输入婚姻状况" class="form-control" type="text" maxlength="30" required>-->
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>政治面貌：</label>
                <div class="col-sm-8">
                    <@f.select name="political" dictType="sys_political" blankValue=""/>
                    <!--<input name="political" id="political" placeholder="请输入婚姻状况" class="form-control" type="text" maxlength="30" required>-->
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>民 族：</label>
                <div class="col-sm-8">
                    <@f.select name="nation" dictType="sys_nation" blankValue=""/>
                    <!--<input name="nation" id="nation" placeholder="请输入民 族" class="form-control" type="text" maxlength="30" required>-->
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>籍 贯：</label>
                <div class="col-sm-8">
                    <@f.treeselect id="areaId" name="natives" boxTitle="请选择地区" url="sys/area/treeData" keyId="name" keyName="name"
                    checked=true correlationId="parentId" placeholder="请选择地区"/>
                    <!--<input name="natives" id="natives" placeholder="请输入婚姻状况" class="form-control" type="text" maxlength="30" required>-->
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>最高学历：</label>
                <div class="col-sm-8">
                    <input name="qualifications" id="qualifications" placeholder="请输入民 族" class="form-control" type="text" maxlength="30" required>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>所学专业：</label>
                <div class="col-sm-8">
                    <input name="major" id="major" placeholder="请输入婚姻状况" class="form-control" type="text" maxlength="30" required>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>毕业学院：</label>
                <div class="col-sm-8">
                    <input name="school" id="school" placeholder="请输入民 族" class="form-control" type="text" maxlength="30" required>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>联系地址：</label>
                <div class="col-sm-8">
                    <input name="address" id="address" placeholder="请输入婚姻状况" class="form-control" type="text" maxlength="30" required>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>电子邮箱：</label>
                <div class="col-sm-8">
                    <@f.input name="email" class="form-control email" butClass="fa fa-fw fa-envelope" maxlength="50" placeholder="请输入邮箱" />                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>手机号码：</label>
                <div class="col-sm-8">
                    <@f.input name="mobile"  maxlength="11" butClass="fa fa-fw fa-mobile"  placeholder="请输入手机号码" required=true/>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>身份证：</label>
                <div class="col-sm-8">
                    <input name="card" id="card" placeholder="请输入婚姻状况" class="form-control" type="text" maxlength="30" required>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>紧急联系电话：</label>
                <div class="col-sm-8">
                    <@f.input name="iphone"  maxlength="11" butClass="fa fa-fw fa-mobile"  placeholder="请输入手机号码" required=true/>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>聘用形式：</label>
                <div class="col-sm-8" >
                    <!--<@f.select name="employ" dictType="employ_type" blankValue="" required=true/>-->
                    <!--<select name="employ" style="width: 50%;height: 25px">-->
                        <!--<option value="0">试用</option>-->
                        <!--<option value="1">合同工</option>-->
                        <!--<option value="2">正式</option>-->
                    <!--</select>-->
                    <@f.select name="employ" dictType="employ_type" blankValue=""/>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "合同签订"/>：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>

                        <input class="form-control time-input" name="contractTime"  data-type="date" data-format="yyyy-MM-dd HH:mm:ss" type="text"  required>
                        <!--readonly="true"-->
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "合同到期"/>：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>

                        <input class="form-control time-input" name="contractEnd"  data-type="date" data-format="yyyy-MM-dd HH:mm:ss" type="text"  required>
                        <!--readonly="true"-->
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">

        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>部门：</label>
                <div class="col-sm-8">
                    <@f.treeselect id="deptId" name="parentId" boxTitle="请选择部门" url="sys/comp/treeData"
                    expandLevel=true isParentIds=true value="${(dept.id)!''}" labelValue="${(dept.name)!''}"
                    parenIdsValue="${(dept.id)!''},${(dept.parentIds)!''}"
                    placeholder="请选择部门" required=true/>


                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>职位：</label>
                <div class="col-sm-8">
                    <input name="position" id="position" placeholder="请输入婚姻状况" class="form-control" type="text" maxlength="30" required>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>职称：</label>
                <div class="col-sm-8">
                    <input name="title" id="title" placeholder="请输入职称" class="form-control" type="text" maxlength="30" required>
                </div>
            </div>
        </div>

        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>银行：</label>
                <div class="col-sm-8">
                    <@f.select name="bank" dictType="sys_bank" blankValue=""/>
                    <!--<input name="bank" id="bank" placeholder="请输入银行" class="form-control" type="text" maxlength="30" required>-->
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>银行卡号：</label>
                <div class="col-sm-8">
                    <input name="bankCode" id="bankCode" placeholder="请输入婚姻状况" class="form-control" type="text" maxlength="30" required>
                </div>
            </div>
        </div>

        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label"><span style="color: red; ">*</span>录用来源：</label>
                <div class="col-sm-8">
                    <@f.select name="source" dictType="hr_source" blankValue=""/>
                    <!--<input name="source" id="source" placeholder="请输入婚姻状况" class="form-control" type="text" maxlength="30" required>-->
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="col-sm-4 control-label">基本工资：</label>
                <div class="col-sm-8">
                    <input name="basicWages" id="basicWages" placeholder="请输入婚姻状况" class="form-control" type="text" maxlength="30" required>

                    <!--<@f.input name="basicWages" class="form-control email" butClass="fa fa-fw fa-envelope" maxlength="50" placeholder="请输入邮箱" />-->
                </div>
            </div>
        </div>

        <!--<div class="col-sm-6">-->
            <!--<div class="form-group">-->
                <!--<label class="col-sm-4 control-label">用户状态：</label>-->
                <!--<div class="col-sm-8">-->
                    <!--<@f.switch name="status" value="0"/>-->
                <!--</div>-->
            <!--</div>-->
        <!--</div>-->
    </div>
</@f.form>
<div class="hr-line-dashed"></div>
<div class="row" id="_addTab">
    <div class="col-sm-offset-5 col-sm-10">
        <button type="button" class="btn btn-sm btn-primary" onclick="opt.form.submit()"><i class="fa fa-check"></i><@ctx.i18n text = "保存"/></button>&nbsp;
        <button type="button" class="btn btn-sm btn-danger" onclick="opt.modal.closeTab()"><i class="fa fa-reply-all"></i><@ctx.i18n text = "关闭"/></button>
    </div>
</div>
</div>
<@footer>
<script type="text/javascript">
    var prefix = baseURL + "bus/personnel";

    /**
     * 表单前端校验
     **/
    // $("#form-user-add").validate({
    //     onkeyup: false,
    //     rules:{
    //         username:{
    //             minlength: 3,
    //             maxlength: 10,
    //             isUserName: opt.common.trim($("#username").val()),
    //             remote: {
    //                 url: prefix + "/checkUserNameUnique",
    //                 type: "POST",
    //                 dataType: "html",
    //                 data: {
    //                     "username": function() {
    //                         return opt.common.trim($("#username").val());
    //                     }
    //                 },
    //                 dataFilter: function(data, type) {
    //                     return opt.validate.unique(data);
    //                 }
    //             }
    //         },
    //         password:{
    //             minlength: 5,
    //             maxlength: 20
    //         },
    //         _role:{
    //             minlength: 1
    //         },
    //         _posts:{
    //             minlength: 1
    //         },
    //         mobile:{
    //             isMobile: opt.common.trim($("#mobile").val()),
    //             remote: {
    //                 url: prefix + "/checkMobileUnique",
    //                 type: "POST",
    //                 dataType: "html",
    //                 data: {
    //                     "mobile": function() {
    //                         return opt.common.trim($("#mobile").val());
    //                     }
    //                 },
    //                 dataFilter: function(data, type) {
    //                     return opt.validate.unique(data);
    //                 }
    //             }
    //         }
    //     },
    //     messages: {
    //         "username": {
    //             remote:"<@ctx.i18n text = "sys.msg.user.already"/>"
    //         },
    //         "mobile":{
    //             remote:"<@ctx.i18n text = "sys.msg.mobile.already"/>"
    //         }
    //     },
    //     focusCleanup: true
    // });

    /**
     * Tab 页面点击确认按钮执行事件
     **/
    function submitHandler() {
        if (opt.validate.form()) {
            opt.operate.saveTab(prefix + "/add", $('#form-user-add').serialize());
        }
    }

    /**
     * select 回调事件
     * @param id 那个select控件发出的事件
     * @param event change 当控件改变时
     * @param data 选中数据对象
     */
    // function selectCallback(id, event, data){
    //     if(id === "roleIdList"){
    //         console.log("roleIdList:" + data);
    //     }else if(id === "postCodes"){
    //         console.log("postCodes:" + data);
    //     }
    // }
</script>
</@footer>
</@pageTheme>